﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcProject.Models.ContractInfo>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    合同信息
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset>
        <legend>合同信息</legend>
        <div class="display-label">
            合同类型</div>
        <div class="display-field">
            <%: Model.ContractType == 1 ? "项目合同" : "人员合同"%></div>
        <div class="display-label">
            合同名称</div>
        <div class="display-field">
            <%: Model.ContractName %></div>
        <div class="display-label">
            合同开始时间</div>
        <div class="display-field">
            <%: String.Format("{0:g}", Model.ContractStartDate) %></div>
        <div class="display-label">
            合同结束时间</div>
        <div class="display-field">
            <%: String.Format("{0:g}", Model.ContractEndDate) %></div>
        <div class="display-label">
            合同金额</div>
        <div class="display-field">
            <%: Model.ContractMoney %></div>
        <div class="display-label">
            合同备注</div>
        <div class="display-field">
            <%: Model.ContractNote %></div>
        <div class="display-label">
            合同附件
        </div>
        <div class="display-field">
            <div>
                <%: Html.ActionLink("上传合同附件", "../Pages/Upload/UploadDefault.aspx", new { fk = Model.ContractId, type = "Contract" }, new { target = "_blank" })%>
            </div>
            <div>
                <table>
                    <tr>
                        <th>
                            附件
                        </th>
                        <th>
                        </th>
                    </tr>
                    <%
                        IEnumerable<MvcProject.Models.AttachInfo> AttachInfos = (IEnumerable<MvcProject.Models.AttachInfo>)ViewData["attachinfos"];
                        if (AttachInfos != null) foreach (var item in AttachInfos)
                            { %>
                    <tr>
                        <td>
                            <%:  Html.ActionLink(item.attachmentName, "../AttachInfo/" + item.attachmentPath, new { }, new { target = "_blank",title="点击查看" })%>
                        </td>
                    </tr>
                    <% } %>
                </table>
            </div>
        </div>
        <div class="display-label">
            创建人</div>
        <div class="display-field">
            <%: Model.CreateUserName %></div>
        <div class="display-label">
            创建时间</div>
        <div class="display-field">
            <%: String.Format("{0:g}", Model.CreateDate) %></div>
    </fieldset>
    <p>
        <%: Html.ActionLink("编辑合同", "Edit", new { id=Model.ContractId }) %>
        |
        <%: Html.ActionLink("成本核算", "../MaterialUseRecord/Create", new { projectId = Model.ForeignerId, teamId = Request["teamId"] })%>
        | <a href="#" onclick="try{opener.location.href=opener.location.href;}catch(e){};window.opener=null;window.open('','_self');window.close();">
            关闭窗口</a>
    </p>
</asp:Content>
